<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>考试系统</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f0f2f5;
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
            min-height: 100vh;
        }

        /* 主容器 */
        .container {
            background-color: white;
            padding: 30px 40px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 600px;
        }

        /* 标题 */
        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 30px;
            font-size: 24px;
        }

        /* 题目区块 */
        .question-block {
            margin-bottom: 25px;
            padding: 15px;
            background-color: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e9ecef;
        }

        .question-block h2 {
            color: #34495e;
            margin-top: 0;
            margin-bottom: 15px;
            font-size: 18px;
        }

        /* 选项样式 */
        .options {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .options label {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #4a5568;
            cursor: pointer;
        }

        /* 输入框样式 */
        input[type="text"] {
            width: 100%;
            padding: 8px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            margin: 5px 0;
            box-sizing: border-box;
        }

        /* 提交按钮 */
        .submit-btn {
            display: block;
            width: 100%;
            padding: 12px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
            margin-top: 20px;
        }

        .submit-btn:hover {
            background-color: #2980b9;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>Java 基础知识测试</h1>
    <form action="exam" method="post">
        <!-- 单选题 -->
        <div class="question-block">
            <h2>1. 以下哪个是 Java 的基本数据类型？</h2>
            <div class="options">
                <label>
                    <input type="radio" name="q1" value="A"> A. int
                </label>
                <label>
                    <input type="radio" name="q1" value="B"> B. String
                </label>
                <label>
                    <input type="radio" name="q1" value="C"> C. ArrayList
                </label>
            </div>
        </div>

        <!-- 多选题 -->
        <div class="question-block">
            <h2>2. 以下哪些是 Java 的访问修饰符？</h2>
            <div class="options">
                <label>
                    <input type="checkbox" name="q2" value="A"> A. public
                </label>
                <label>
                    <input type="checkbox" name="q2" value="B"> B. private
                </label>
                <label>
                    <input type="checkbox" name="q2" value="C"> C. protected
                </label>
                <label>
                    <input type="checkbox" name="q2" value="D"> D. default
                </label>
            </div>
        </div>

        <!-- 填空题 -->
        <div class="question-block">
            <h2>3. Java 中的单例模式有 ______ 和 ______ 两种实现方式。</h2>
            <input type="text" name="q3_1" placeholder="请输入第一个答案">
            <input type="text" name="q3_2" placeholder="请输入第二个答案">
        </div>
        <button type="submit" class="submit-btn">提交试卷</button>
    </form>
</div>
</body>
</html>